sed & awk, 2nd Edition by Dale Dougherty;Arnold Robbins
Author:Dale Dougherty;Arnold Robbins
Format: mobi
Tags: COMPUTERS / Operating Systems / UNIX
Publisher: O'Reilly Media
Published: 2010-11-19T00:00:00+00:00
Before any input is read, the bitmap array is loaded with O's. This array has 144 elements. The input to this program is a series of coordinates, one per line.
$ cat bitmap.test
1,1
2,2
3,3
4,4
5,5
6,6
7,7
8,8
9,9
10,10
11,11
12,12
1,12
2,11
3,10
4,9
5,8
6,7
7,6
8,5
9,4
10,3
11,2
12,1
For each coordinate, the program will put an "X" in place of an "O" as that element of the array. At the end of the script, the same kind of loop that loaded the array, now outputs it. The following example reads the input from the file bitmap.test.
$ awk -f bitmap.awk bitmap.test
XOOOOOOOOOOX
OXOOOOOOOOXO
OOXOOOOOOXOO
OOOXOOOOXOOO
OOOOXOOXOOOO
OOOOOXXOOOOO
OOOOOXXOOOOO
OOOOXOOXOOOO
OOOXOOOOXOOO
OOXOOOOOOXOO
OXOOOOOOOOXO
XOOOOOOOOOOX
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12645)
Hello! Python by Anthony Briggs(9948)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9825)
The Mikado Method by Ola Ellnestam Daniel Brolund(9814)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(9711)
Dependency Injection in .NET by Mark Seemann(9369)
Hit Refresh by Satya Nadella(8855)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8334)
The Kubernetes Operator Framework Book by Michael Dame(7940)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7811)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7791)
Exploring Deepfakes by Bryan Lyon and Matt Tora(7728)
Grails in Action by Glen Smith Peter Ledbrook(7722)
Practical Computer Architecture with Python and ARM by Alan Clements(7673)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7639)
Robo-Advisor with Python by Aki Ranin(7625)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7591)
Building Low Latency Applications with C++ by Sourav Ghosh(7514)
Svelte with Test-Driven Development by Daniel Irvine(7493)
